<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="vue/vue.js"></script>
    <title>Document</title>
</head>
<body>
    <div id="app">
        <p>{{msg}}</p>
        <button v-on:click="reverseMsg">按钮</button>
    </div>
    <script>
        var vm = new Vue({
            el:'#app',
            data:{
                msg:'Hello Vue.js'
            },
            methods:{
                reverseMsg:function(){
                    //顺序反转
                    this.msg = this.msg.split('').reverse().join('')
                }
            }
        })
    </script>
</body>
</html>